<?php /* SVN: $Id: index_list.ctp 99 2008-07-09 09:33:42Z rajesh_04ag02 $ */ ?>
<div class="blogComments index js-response">
	<div class="comments-top">
		 <div class="comment clearfix">
			<h2><?php echo __l('Comments'); ?> (<?php echo $blog['Blog']['blog_comment_count'];?>)</h2>
		</div>
	</div>

<?php echo $this->element('paging_counter'); ?>
<ol class="list clearfix comments comments-list js-responses-<?php echo $blog['Blog']['id'];?>"  start="<?php echo $this->Paginator->counter(array('format' => '%start%')); ?>">
<?php
if (!empty($blogComments)):
    foreach($blogComments as $blogComment):
?>
	<li class="round-5 list-row comment clearfix" id="comment-<?php echo $blogComment['BlogComment']['id']; ?>">
       <div class="grid_1">
       	 <?php echo $this->Html->getUserAvatar($blogComment['User']['id'],'small_thumb');?>
       </div>
       <div class="user-comments data grid_11">
       <div class="listing-head clearfix">
         <h4><?php echo $this->Html->link('', '#comment-'.$blogComment['BlogComment']['id'], array('class' => 'js-scrollto')); ?>
			<span class="author"><?php echo $this->Html->link($blogComment['User']['username'], array('controller' => 'users', 'action' => 'view', $blogComment['User']['username']), array('title' => $blogComment['User']['username'], 'escape' => false)); ?></span> 
			 <span class="meta date-block-info">
				<span class="publish"><?php echo __l('Posted'); ?></span>
				<span class="date">
					<?php echo $this->Html->cDateTimeHighlight($blogComment['BlogComment']['created']); ?>
				</span>
			</span>
		</h4>
		</div>
		<blockquote>
           <p class="js-truncate {'size':100}"><?php echo $this->Html->cText($blogComment['BlogComment']['comment']);?></p>
         </blockquote>
        
        <?php if ($blog['Project']['User']['id'] == $this->Auth->user('id') || $this->Auth->user('user_type_id') == ConstUserTypes::Admin) { ?>
        <div class="actions">
			<?php echo $this->Html->link(__l('Delete'), array('controller' => 'blog_comments', 'action' => 'delete', $blogComment['BlogComment']['id']), array('class' => 'delete  js-ajax-delete', 'title' => __l('Delete')));?>
		</div>
		<?php } ?>
		</div>
        
     </li>
<?php
    endforeach;
else:
?>
	<li>
		<p class="notice"><?php echo __l('No comments available'); ?></p>
	</li>
<?php
endif;
?>
</ol>
<div class="js-pagination">
<?php
if (!empty($blogComments)) {
    echo $this->element('paging_links');
}
?>
</div>
</div>